<?php

/*
Process Delete Item (admin_delete_item.pro.php)
*/

$rank_check = "7";
include "../global.inc.php";

$getItem = fetch("SELECT * FROM items2 WHERE item_name = '$item_name' AND game = '$game'");

if (!$getItem[id])
{
	die(header(error("admin_delete_item.php?game=$game", "That item does not exsist.")));
}
else
{
	mysql_query("DELETE FROM items2 WHERE item_name = '$getItem[item_name]' AND game = '$game'");
	mysql_query("DELETE FROM auctions2 WHERE item_name = '$getItem[item_name]' AND game = '$game'");
	mysql_query("DELETE FROM battle_items WHERE item_id = '$getItem[id]' AND game = '$game'");
	mysql_query("DELETE FROM battle_items2 WHERE item_id = '$getItem[id]' AND game = '$game'");
	mysql_query("DELETE FROM equipped_items2 WHERE item_id = '$getItem[id]' AND game = '$game'");
	mysql_query("DELETE FROM penny_store2 WHERE item_id = '$getItem[id]' AND game = '$game'");
	mysql_query("DELETE FROM safety_box WHERE item_id = '$getItem[id]' AND game = '$game'");
	mysql_query("DELETE FROM shop_items2 WHERE item_name = '$getItem[item_name]' AND game = '$game'");
	mysql_query("DELETE FROM usershops_items2 WHERE item_id = '$getItem[id]' AND game = '$game'");
	mysql_query("DELETE FROM usersitems2 WHERE item_id = '$getItem[id]' AND game = '$game'");
	
	die(header(error("admin_delete_item.php?game=$game", "$getItem[item_name] has been deleted.")));
}

?>
